const path = require('path');

const resolve = (dir) => path.join(__dirname, dir);
console.log('环境路由变量',process.env.VUE_APP_ROUTER)
module.exports = {
	// cli3 代理是从指定的target后面开始匹配的，不是任意位置；配置pathRewrite可以做替换
	devServer: {
		port: 9898,
		open: true,
		proxy: {
			'/your api': {
				target: 'your server',
				changeOrigin: true,
				pathRewrite: {}
			}
		},
		
	},
	
	chainWebpack: (config) => {
		config.resolve.alias
		  .set('@', resolve('src'))
    },
	
    publicPath: './',
	lintOnSave: false,
		// css相关配置
	css: {
		// 是否使用css分离插件 ExtractTextPlugin
		extract: true,
		// 开启 CSS source maps?
		sourceMap: false,
		// css预设器配置项(全局引入)
		loaderOptions: {
			sass: {
				// data: `@import "@/styles/colorConfig.scss";` process.env.NODE_ENV === 'production'
				data: process.env.VUE_APP_ROUTER === 'operate' ? `@import "@/styles/colorConfig/operate.scss";` : `@import "@/styles/colorConfig/health.scss";`
			}
		}
	}
	

}


